<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #app {
      height: 100px;
    }
  </style>
</head>

<body>
  <div id="app"></div>
  <div id="app1"></div>

  <button id="btn">点击获取当前时间</button>
  <button id="btn1">点击获取七天后的时间</button>

  <script>
    /*
      1. 说明 a = b = c = d = 1;的执行过程
      2. for(var i = 0,j = 0; i < 5, j < 10; i++,j++){} 请问当前for循环的循环次数??为什么
      3. 代码题:请得到7天以后的现在的时间
      4. 代码题:'abaabgfdebbafefgfsrsbabesseeeeaa' 请计算每一个字母出现的次数,及出现最多次数的字母
    */

    // 时间的函数
    function getdate(s) {
      const date = new Date();
      let n = date.getFullYear();
      let y = date.getMonth();
      let dates = date.getDate();
      let h = date.getHours();
      let f = date.getMinutes();
      let m = date.getSeconds();

      console.log(h, f, m);
      return `现在是${n}年${y + 1}月${dates + s}日---${h}:${f}:${m}`;
    }
    const appEle = document.querySelector("#app");
    const appEle1 = document.querySelector("#app1");

    btn.onclick = function () {

      appEle.innerHTML = `<h1>现在的时间${getdate(0)}</h1>`;
    };
    btn1.onclick = function () {
      appEle1.innerHTML = `<h1>七天后的时间${getdate(7)}</h1>`;

    };



    const str = 'abaabgfdebbafefgfsrsbabesseeeeaa';
  </script>
</body>

</html>